/*
 * MODULE NAME:    hci_primitives.h
 * DESCRIPTION:    HCI Service Primitive Declarations
 * AUTHOR:         Martin Mellody
 *
 * SOURCE CONTROL: $Id: hci_primitives.h,v 1.1.1.1 2007/12/18 05:32:40 tianwq Exp $
 *
 * LICENSE:
 *     This source code is copyright (c) 2000-2002 RDA Microelectronics.
 *     All rights reserved.
 *
 */             

#ifndef rdabt_HCI_PRIMITIVES_H
#    define rdabt_HCI_PRIMITIVES_H

#include "host_config.h"

extern volatile u_int8 rdabt_hci_start_complete;
extern volatile u_int8 rdabt_hci_hc_responding;

/*
	Maximum lengths of command pdus not completely encoded by table
*/
#define HCI_cmdSETEVENTFILTER_LEN				0x0C
#define HCI_cmdHOSTNUMCOMPLETEDPACKETS_LEN		0x102
#define HCI_cmdWRITECURRENTIACLAP_LEN			0xC4
#define HCI_cmdWRITESTOREDLINKKEY_LEN			0x102
#define HCI_cmdCHANGELOCALNAME_LEN				0xFB


// constants for secure simple pairing

//IO capability
#define IOCAP_DISPLAY_ONLY		0x00
#define IOCAP_DISPLAY_YESNO		0x01
#define IOCAP_KEYBOARD_ONLY		0x02
#define IOCAP_NOIN_NOOUT		0x03	// no Input, no output

//OOB data present
#define OOB_DATA_NOT_PRE		0x00
#define OOB_DATA_FROM_REMOTE	0x01

//authentication requirements
#define MITM_NOTREQUIRED_NOBONDING	0x00
#define MITM_REQUIRED_NOBONDING		0x01
#define MITM_NOTREQUIRED_DEDICATED  0x02
#define MITM_REQUIRED_DEDICATED		0x03
#define MITM_NOTREQUIRED_GENERAL	0x04
#define MITM_REQUIRED_GENERAL		0x05

/*
    HCI non-API functions 
*/
t_api rdabt_hci_layer_ctrl(u_int8 flag);


/* Data primitives for L2CAP to use */
t_api rdabt_hci_GetCommandBuffer(u_int16 length, u_int32 flags, rdabt_host_buf_t **p_buf);
t_api rdabt_hci_GetWriteBuffer(u_int16 handle, u_int16 length, u_int32 flags, rdabt_host_buf_t **p_buf);
t_api rdabt_hci_GetSCOBuffer(u_int16 handle, u_int16 length, u_int32 flags, rdabt_host_buf_t **p_buf);
t_api rdabt_hci_FreeWriteBuffer(rdabt_host_buf_t *p_buf);
t_api rdabt_hci_ReleaseCommandBuffer(rdabt_host_buf_t *p_buf);
t_api rdabt_hci_TransportFreeBuffer(rdabt_host_buf_t *p_buf, u_int8 type);
t_api rdabt_hci_HaveBuff(u_int16 handle, u_int16 len, u_int8 isAlloc);

#endif

